import request from '@/utils/request'

const API_NAME = '/admin/edu/videos'

export default {
  // 根据ID获取一个视频
  queryById(id) {
    return request({
      url: `${API_NAME}/${id}`,
      method: 'get'
    })
  },
  // 新增一个视频
  insert(video) {
    return request({
      url: `${API_NAME}/`,
      method: 'post',
      data: video
    })
  },
  // 修改一个视频
  update(video) {
    return request({
      url: `${API_NAME}/`,
      method: 'put',
      data: video
    })
  },
  // 根据ID删除视频
  deleteById(id) {
    return request({
      url: `${API_NAME}/${id}`,
      method: 'delete'
    })
  },
  // 获取视频数量
  count(){
    return request({
      url: `${API_NAME}/count`,
      method: 'get'
    })
  }
}
